package com.xframe.domain.sys;

import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @Description: 值列表
 * @ClassName: SysValueDic
 * @Author: xufeng
 * @CreateTime: 2023/4/3 18:38
 **/
@Data
@Accessors(chain = true)
@XTable(value = "sys_values", label = "值列表")
@XSelectItem(keyName = "valCode",codeName = "valCode",textName = "valName")
@XHasMany(typeName = "com.xframe.domain.sys.SysValueDetail",foreignKey = "valCode", targetKey = "valCode",as = "valueList")
public class SysValueDic extends BaseModel {

    /**
     * 主键
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "val_id", primaryKeyFlag = true,desc = "主键")
    private Long valId;

    /**
     * 值列表编码
     */
    @XQueryCondition
    @XGridTableRef
    @XColumn(length = 50,desc = "值列表编码",uniqueFlag = true)
    private String valCode;

    /**
     * 值列表名称
     */
    @XQueryCondition
    @XGridTableRef
    @XColumn(length = 200,desc = "值列表名称")
    private String valName;

    /**
     * 备注
     */
    @XColumn(length = 500,desc = "备注",nullFlag = true)
    private String remark;

    /**
     * 子表信息
     */
    private List<SysValueDetail> valueList;
}
